package basic.lessons;

public class RollDicesSnakeEyes 
{
	private static int diceNumber1 =0;
	private static int diceNumber2 =0; // variables will hold dices numbers
	
	public int rollDice ()
	{
		return 1 + (int)(Math.random() * ((6 - 1) + 1));// returns integer value in the range of [1;6]
	}
	static int numberOfRolls = 0;
	
	static RollDicesSnakeEyes r = new RollDicesSnakeEyes();
	public static void main(String[] args)
	{
		while (diceNumber1!=1 || diceNumber2 !=1)
		{
			diceNumber1 = r.rollDice();
			diceNumber2 = r.rollDice();
			numberOfRolls ++;
			System.out.println("value of dice 1 = "+ diceNumber1);
			System.out.println("value of dice 2 = "+ diceNumber2);
			
		}
		System.out.println ("Total number of rolls to get 1 on both dices = "+numberOfRolls);

	}

}
